autowatch=1;

function get_path(){
    var p=this.patcher;
    var path=p.filepath;
    if(!path){
        var i=0;
        while(!path && i<20){
            p=p.parentpatcher;
            path=p.filepath;
            i++;
        }
    }

    outlet(0, ['path', path+'/']);
}

function is_subpatcher(){
    outlet(0, ['is_subpatcher',this.patcher.parentpatcher?1:0]);
}